<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('basic',$postdata);
		exi('设置成功');
	}
	$footernav =array(
		array('title'=>'首页','icon'=>'icon-shouye','action'=>'jy_newcar/index/'),
		array('title'=>'购车中心','icon'=>'icon-dingdan','action'=>'jy_newcar/gou.index/'),
		array('title'=>'卖车推广组','icon'=>'icon-dixiaofei','action'=>'jy_newcar/gou.tuilog/'),
		array('title'=>'我的团队','icon'=>'icon-paihao0','action'=>'jy_newcar/gou.down/'),
	);	
	$return['item']=$this->plugin_setting('basic');
	$return['item']['gfooternav']=$return['item']['gfooternav']?:$footernav;
	$aitip='启用后才生效！';
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		'tabs'=>$tabs,
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基础设置',
				'list'=>array(
					array('type'=>'tip','title'=>$aitip),
					//array('type'=>'switch','title'=>'是否启用？','name'=>'g_open'),
					array('type'=>'radio','title'=>'成为购车合伙人条件','name'=>'g_become','options'=>'become','help'=>''),
					array('type'=>'link','from'=>'action','title'=>'二维码跳转链接','name'=>'share_link','help'=>'默认跳转到商城首页，指定链接后，跳转到指定页面！'),
				)
			),
			array(
				'title'=>'合伙人设置',
				'list'=>array(
					//array('type'=>'radio','title'=>'合伙人必须完善资料','name'=>'become_reg','options'=>'is'),
					array('type'=>'tip','title'=>'
					车贷还款期数说明：系统设置车贷还款期数为36期
					2.1、第1台车，奖励4期：车指导价价29.98万×0.8÷36期=6662元/期×4期=26648元
					2.2、第2台车，奖励8期：车指导价25.98万×0.8÷36期=5773元/期×8期=46184元
					2.3、第3台车，奖励剩余期数：车指导价21.98万元；计算公式如下：
					①、三台车指导价总和×0.8÷3台车=所得总奖励：（29.98万+25.98万+21.98万）×0.8÷3台车= 207840②、所得总奖励-已支付2台车奖励=剩余奖励：207840元-（26648元+46184元）=135008元
					③、剩余奖励÷剩余期数=每月奖励（按月支付）：135008÷（36期-4期-8期）=5773元/期
					'),
					array('type'=>'unitstring','unit'=>'期','name'=>'g_fee1','title'=>'第1台车奖励N期'),
					array('type'=>'unitstring','unit'=>'期','name'=>'g_fee2','title'=>'第2台车奖励N期'),
					array('type'=>'unitstring','unit'=>'期','name'=>'g_fee3','title'=>'第3台车奖励N期'),						
					)
			),
			array(
				'title'=>'底部导航',
					'list'=>array(
								array('type'=>'array','name'=>'gfooternav','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标','help'=>'图标，例如：icon-shouye'),							
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
								),
					)
			),
		)
	);
	$return['become']=array('0'=>'无条件','1'=>'支付购车定金');
	$return['leveltype']=$this->level_up_types;
	$return['otherfee_types']=$this->model('model')->otherfee_types();
	$return['withdraw']=$this->pay_types;
	$return['commissiontype']=$this->commission_types;
	$return['is']=array('0'=>'否','1'=>'是');
	$return['level']=$this->level_types;
	$return['gift_type']=$this->gift_type;
	$return['levelfee_type']=$this->levelfee_type;
	$return['pay_type']=get_pay_types();
	$return['htmls']=$htmls;
	exi($return);
}